home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Tools & Apps / Networking & Communications / TCPTool / ASR.c < prev    next >
Encoding:
C/C++ Source or Header  |  1990-09-14  |  1.9 KB  |  80 lines  |  [TEXT/MPS ]

  1. #include    <MacTCPCommonTypes.h>>
  2. #include    <TCPPB.h>
  3.  
  4. #define        _STORAGE_    true
  5. #include    <TCP.h>
  6.  
  7. pascal void ASR (StreamPtr stream, unsigned short eventCode, Ptr userData, unsigned short terminReason, struct ICMPReport *icmpMsg)
  8. {
  9.     switch (eventCode) {
  10.         case TCPClosing :
  11.             DebugStr("\pTCPClosing");
  12.             break;
  13.         case TCPULPTimeout :
  14.             DebugStr("\pTCPULPTimeout");
  15.             break;
  16.         case TCPTerminate :
  17.             switch (terminReason) {
  18.                 case TCPULPAbort :
  19.                     DebugStr("\pTCPULPAbort");
  20.                     break;
  21.                 case TCPRemoteAbort :
  22.                     DebugStr("\pTCPRemoteAbort");
  23.                     break;
  24.                 case TCPNetworkFailure :
  25.                     DebugStr("\pTCPNetworkFailure");
  26.                     break;
  27.                 case TCPSecPrecMismatch :
  28.                     DebugStr("\pTCPSecPrecMismatch");
  29.                     break;
  30.                 case TCPULPTimeoutTerminate :
  31.                     DebugStr("\pTCPULPTimeoutTerminate");
  32.                     break;
  33.                 case TCPULPClose :
  34.                     DebugStr("\pTCPULPClose");
  35.                     break;
  36.                 case TCPServiceError :
  37.                     DebugStr("\pTCPServiceError");
  38.                     break;
  39.             }
  40.             break;
  41.         case TCPDataArrival :
  42.             DebugStr("\pTCPDataArrival");
  43.             break;
  44.         case TCPUrgent :
  45.             DebugStr("\pTCPUrgent");
  46.             break;
  47.         case TCPICMPReceived :
  48.             switch (icmpMsg->reportType) {
  49.                 case netUnreach :
  50.                     DebugStr("\pTCPICMPReceived netUnreach");
  51.                     break;
  52.                 case hostUnreach :
  53.                     DebugStr("\pTCPICMPReceived hostUnreach");
  54.                     break;
  55.                 case protocolUnreach :
  56.                     DebugStr("\pTCPICMPReceived protocolUnreach");
  57.                     break;
  58.                 case portUnreach :
  59.                     DebugStr("\pTCPICMPReceived portUnreach");
  60.                     break;
  61.                 case fragReqd :
  62.                     DebugStr("\pTCPICMPReceived fragReqd");
  63.                     break;
  64.                 case sourceRouteFailed :
  65.                     DebugStr("\pTCPICMPReceived sourceRouteFailed");
  66.                     break;
  67.                 case timeExceeded :
  68.                     DebugStr("\pTCPICMPReceived timeExceeded");
  69.                     break;
  70.                 case parmProblem :
  71.                     DebugStr("\pTCPICMPReceived parmProblem");
  72.                     break;
  73.                 case missingOption :
  74.                     DebugStr("\pTCPICMPReceived missingOption");
  75.                     break;
  76.             }
  77.             break;
  78.     }
  79. }
  80.